package com.iot08.admin.controller;

/**
 * @author cwj
 * @description
 * @date 2025/1/22 9:26
 **/

import com.iot08.admin.controller.base.BaseController;
import com.iot08.admin.service.PaymentService;
import com.iot08.common.response.Response;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("payment")
public class PaymentController extends BaseController {
    
    @Resource
    private PaymentService paymentService;
    
    /**
     * @description 
     * @author cwj
     * @param [vo]
     * @return com.iot08.common.response.Response<java.lang.Object>
     * @date @time 2025/1/22 10:33
     **/
    @ResponseBody
    @RequestMapping(value = "refundApply", method = RequestMethod.POST)
    public Response<Object> refundApply(@RequestParam("orderId") String orderId) {
         if(StringUtils.isEmpty(orderId)){
             return Response.failedResponse("请求参数不能为空");
         }
         return paymentService.refundApply(orderId);
    }

    /**
     * @description
     * @author cwj
     * @param [orderId]
     * @return com.iot08.common.response.Response<java.lang.Object>
     * @date @time 2025/2/24 15:45
     **/
    @ResponseBody
    @RequestMapping(value = "queryOrderStatus", method = RequestMethod.POST)
    public Response<Object> queryApplyPayOrderStatus(@RequestParam("orderId") String orderId){
        if(StringUtils.isEmpty(orderId)){
            return Response.failedResponse("请求参数不能为空");
        }
        return paymentService.queryApplyPayOrderStatus(orderId);
    }



}
